package com.iman.Confucius.mappers;

import com.iman.Confucius.mappers.models.DrmStudyRemarkLog;
import com.iman.Confucius.mappers.models.DrmStudyRemarkLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmStudyRemarkLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int countByExample(DrmStudyRemarkLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int deleteByExample(DrmStudyRemarkLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Delete({
        "delete from drm_study_remark_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Insert({
        "insert into drm_study_remark_log (id, course_id, ",
        "user_id, category_id, ",
        "study_time, progress, ",
        "laststudy_dt, ",
        "create_dt, ",
        "study_fk_id)",
        "values (#{id,jdbcType=BIGINT}, #{courseId,jdbcType=BIGINT}, ",
        "#{userId,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, ",
        "#{studyTime,jdbcType=INTEGER}, #{progress,jdbcType=INTEGER}, ",
        "#{laststudyDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{createDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{studyFkId,jdbcType=BIGINT})"
    })
    int insert(DrmStudyRemarkLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int insertSelective(DrmStudyRemarkLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    List<DrmStudyRemarkLog> selectByExample(DrmStudyRemarkLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Select({
        "select",
        "id, course_id, user_id, category_id, study_time, progress, laststudy_dt, create_dt, ",
        "study_fk_id",
        "from drm_study_remark_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmStudyRemarkLog selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmStudyRemarkLog record, @Param("example") DrmStudyRemarkLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExample(@Param("record") DrmStudyRemarkLog record, @Param("example") DrmStudyRemarkLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByPrimaryKeySelective(DrmStudyRemarkLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_remark_log
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Update({
        "update drm_study_remark_log",
        "set course_id = #{courseId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "category_id = #{categoryId,jdbcType=BIGINT},",
          "study_time = #{studyTime,jdbcType=INTEGER},",
          "progress = #{progress,jdbcType=INTEGER},",
          "laststudy_dt = #{laststudyDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "create_dt = #{createDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "study_fk_id = #{studyFkId,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmStudyRemarkLog record);
}